<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        /* .a {
            width: 300px;
            height: 300px;
            display: flex;
            align-items: center;
            justify-content: center;
            border: 1px solid black;
        }
        .b{
            width: 200px;
            height: 200px;
            background-color: #ccc;
        } */
    </style>
</head>
<body>
    <!-- <h1>本地存储</h1>
    <input type="text" class="txt">
    <hr>
    <button onclick="myset()">存</button>
    <button onclick="myget()">取</button>
    <button onclick="myclear()">清空</button> -->
    <!-- <div class="a">
        <div class="b"></div>
    </div> -->
    <script>
        // function myset(){
        //     let v=document.querySelector(".txt").value;
        //     localStorage.setItem("stname",v);
        //     console.log(v)
        // }
        // function myget(){
        //     var v=localStorage.getItem("stname");
        //     document.querySelector(".txt").value=v;
        // }
        // function myclear(){
        //     localStorage.clear();
        // }
        let div=document.createElement("div");
        div.id="container";
        let h1=document.createElement("h1");
        h1.className="title"
        h1.innerHTML="我是标题"
        div.appendChild(h1);
        let span=document.createElement("span");
        span.innerText="小米 su 7"
        span.setAttribute("price","20w")
        div.appendChild(span);
        document.body.appendChild(div);
    </script>
</body>
</html>